﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="TPCN.Default1" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="head" ContentPlaceHolderID="head" runat="server">
    <link href="App_Themes/Default/listview-item.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="content" ContentPlaceHolderID="content" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div class="box">
        <div class="boxtitle">
            Sản phẩm</div>
        <div class="boxcontent">
            <div class="centeralign">
                <telerik:RadAjaxLoadingPanel ID="ListViewLoading" runat="server" 
                    Skin="Default" />
                <asp:Panel ID="listviewPanel" runat="server">
                    <telerik:RadListView ID="HangListView" runat="server" AllowPaging="True"
                        ItemPlaceholderID="ProductsHolder" 
                        OnItemCommand="HangListView_ItemCommand" Width="100%"
                        DataKeyNames="HangID">
                        <LayoutTemplate>
                            <div>
                                <asp:Panel ID="ProductsHolder" runat="server" />
                                <div class="clear">
                                </div>
                            </div>
                            <div class="listview-pager">
                                <div>
                                    <telerik:RadDataPager ID="HangListViewPager" runat="server" PagedControlID="HangListView"
                                        PageSize="30" BackColor="White" BorderStyle="None" Skin="WebBlue">
                                        <Fields>
                                            <telerik:RadDataPagerButtonField FieldType="Numeric" PageButtonCount="10" HorizontalPosition="NoFloat"/>
                                        </Fields>
                                    </telerik:RadDataPager>
                                </div>
                                <div class="clear">
                                </div>
                            </div>
                        </LayoutTemplate>
                        <ItemTemplate>
                            <div class="product">
                                <div class="product-img">
                                    <div class="sale">
                                        <asp:Label ID="lblPercent" runat="server" Text='<%# ProcessSale(Eval("Giathitruong").ToString(), Eval("Giabanle").ToString()) %>'></asp:Label>
                                    </div>
                                    <asp:HyperLink ID="lnkImg" runat="server" NavigateUrl='<%# BuildProductDetailPath(Eval("HangID")) %>'>
                                        <asp:Image ID="imgAnh" runat="server" Height="150px" Width="150px" ImageUrl='<%# Eval("Anh") %>'
                                            ToolTip='<%# Eval("Thongtinsoluoc") %>' />
                                            </asp:HyperLink>
                                            
                                </div>
                                <div class="product-name">
                                    <asp:HyperLink ID="lnkTenhang" runat="server" Text='<%# cutProductName(Eval("Tenhang")) %>'
                                        NavigateUrl='<%# BuildProductDetailPath(Eval("HangID")) %>' ToolTip='<%# Eval("Tenhang") %>'></asp:HyperLink>
                                </div>
                                <hr />
                                <div>
                                    <div class="product-price">
                                        <asp:Label ID="lblGia" runat="server" Text='<%# FormatString(Eval("Giabanle")) %>'></asp:Label>
                                    </div>
                                    <%--<div class="product-addtocart">
                                        <asp:ImageButton ID="btnAddtocart" runat="server" ImageUrl="~/App_Themes/Default/images/addtocart.png"
                                            ToolTip="Thêm vào giỏ hàng" CommandArgument='<%# Eval("HangID") %>' CommandName="AddToCart" />
                                    </div>--%>
                                    <div class="clear">
                                    </div>
                                </div>
                            </div>
                        </ItemTemplate>
                    </telerik:RadListView>
                    <div class="clear">
                    </div>
                </asp:Panel>
            </div>
        </div>
    </div>
    <telerik:RadAjaxManager runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="listviewPanel">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="listviewPanel" 
                        LoadingPanelID="ListViewLoading" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
</asp:Content>
